using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Security.Cryptography;
using System.Text;
public class DamaUtil
{
	private const int int_0 = 99881;
	private const int int_1 = 1004;
	private const string string_0 = "06ada1d03089445faa6aba961823b1e1";
	private bool bool_0;
	public string method_0(string string_1, string string_2)
	{
		if (IntPtr.Size == 4)
		{
			DamaUser2.uu_setSoftInfo(99881, "06ada1d03089445faa6aba961823b1e1");
			if (DamaUser2.uu_login(string_1, string_2) > 0)
			{
				this.bool_0 = true;
				int num = DamaUser2.uu_getScore(string_1, string_2);
				return "登录成功！当前点数:[" + num + "]";
			}
			return "登录失败！";
		}
		else
		{
			DamaUser.uu_setSoftInfo(99881, "06ada1d03089445faa6aba961823b1e1");
			if (DamaUser.uu_login(string_1, string_2) > 0)
			{
				this.bool_0 = true;
				int num = DamaUser.uu_getScore(string_1, string_2);
				return "登录成功！当前点数:[" + num + "]";
			}
			return "登录失败！";
		}
	}
	public static string recognition(Image image_0)
	{
		MemoryStream memoryStream = new MemoryStream();
		image_0.Save(memoryStream, ImageFormat.Jpeg);
		byte[] array = new byte[memoryStream.Length];
		memoryStream.Position = 0L;
		memoryStream.Read(array, 0, array.Length);
		memoryStream.Flush();
		StringBuilder stringBuilder = new StringBuilder(50);
		if (IntPtr.Size == 4)
		{
			DamaUser2.uu_recognizeByCodeTypeAndBytes(array, array.Length, 1004, stringBuilder);
		}
		else
		{
			DamaUser.uu_recognizeByCodeTypeAndBytes(array, array.Length, 1004, stringBuilder);
		}
		memoryStream.Close();
		memoryStream.Dispose();
		return stringBuilder.ToString().Split(new char[]
		{
			'_'
		})[1];
	}
	public string method_2(string string_1, int int_2, int int_3, string string_2)
	{
		if (string.IsNullOrEmpty(string_1))
		{
			return string_1;
		}
		if (string_1[0] == '-')
		{
			return string_1;
		}
		string[] array = string_1.Split(new char[]
		{
			'_'
		});
		string text = array[0];
		string text2 = array[1];
		string value = DamaUtil.smethod_0(int_2.ToString() + string_2 + int_3.ToString() + text2.ToUpper()).ToUpper();
		if (text.Equals(value))
		{
			return text2;
		}
		return "结果校验不正确";
	}
	public static string smethod_0(string string_1)
	{
		MD5 mD = MD5.Create();
		byte[] bytes = Encoding.UTF8.GetBytes(string_1);
		byte[] array = mD.ComputeHash(bytes);
		StringBuilder stringBuilder = new StringBuilder();
		byte[] array2 = array;
		for (int i = 0; i < array2.Length; i++)
		{
			byte b = array2[i];
			stringBuilder.Append(b.ToString("x2"));
		}
		return stringBuilder.ToString();
	}
}
